﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:FluentFTP_Converters="clr-namespace:FluentFTP.Converters" mc:Ignorable="d" x:Class="FluentFTP.View.MainView"
        Title="Fluent FTP" Height="488" Width="770">
	<Window.Resources>
		<FluentFTP_Converters:LongToFileSize x:Key="LongToFileSize"/>
	</Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Menu Margin="0,0.124,0,0" Background="Gainsboro">
            <MenuItem Header="Connections">
                <MenuItem Header="Connect ..." Command="{Binding ConnectDialogCommand}"/>
            </MenuItem>
            <MenuItem Header="Actions">
                <MenuItem Header="Save" Command="{Binding DownloadCommand}"/>
                <MenuItem Header="Save As ..." Command="{Binding DownloadAsCommand}"/>
                <MenuItem Header="Upload ..." Command="{Binding Upload}"/>
                <MenuItem Header="Create Directory" Command="{Binding CreateDirectory}"/>
                <MenuItem Header="Refresh Directory" Command="{Binding Reload}"/>
            </MenuItem>
            <MenuItem Header="Settings">
                <MenuItem Header="User Settings ..." Command="{Binding OpenUserSettings}"/>
                <MenuItem Header="Servers ..." Command="{Binding OpenServerSettings}" />
            </MenuItem>
            <MenuItem Header="Help">
                <MenuItem Header="About"/>
            </MenuItem>
        </Menu>
        <ListView x:Name="MainListView" Margin="8" Grid.Row="2" ItemsSource="{Binding Folders}" SelectedItem="{Binding SelectedItem}">
            <ListView.ItemContainerStyle>
                <!-- Courtesy of Oliver at http://stackoverflow.com/a/1785262/404764 -->
                <Style TargetType="{x:Type ListViewItem}">
                    <EventSetter Event="Control.MouseDoubleClick" Handler="MainListView_MouseDoubleClick" />
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Name" Width="250" DisplayMemberBinding="{Binding Name}"/>
                    <GridViewColumn Header="Type" Width="80" DisplayMemberBinding="{Binding Type}"/>
                    <GridViewColumn Header="Time Stamp" Width="120" DisplayMemberBinding="{Binding TimeStamp}"/>
                    <GridViewColumn Header="Size" Width="150" DisplayMemberBinding="{Binding Size, Converter={StaticResource LongToFileSize}}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <ProgressBar HorizontalAlignment="Right" Width="150" Margin="0,10.709,8,8" Grid.Row="1" IsIndeterminate="{Binding IsBusy}"/>
        <StackPanel Margin="8" Grid.Row="1" Orientation="Horizontal">
            <Button x:Name="UpButton" Content="Go Up" Command="{Binding UpCommand}"/>
        </StackPanel>
        <TextBlock Grid.Row="1" TextWrapping="Wrap" Text="{Binding CurrentPath}" VerticalAlignment="Center" d:LayoutOverrides="Width" HorizontalAlignment="Center" Foreground="#7F000000" FontStyle="Italic" FontSize="10.667"/>

    </Grid>
</Window>
